import tensorflow as tf
import numpy as np
import os
def train():
    x = tf.placeholder(tf.float32,[None,3072])
    y= tf.placeholder(tf.int64,[None])
    y_ =tf.placeholder(tf.int64,[None])
    #计算损失函数
    loss = tf.losses.sparse_softmax_cross_entropy(y,y_)
    predict = tf.argmax(y_,1)
    corrext_predixction = tf.equal(predict,y)
    accuracy = tf.reduce_mean(tf.cast(corrext_predixction,tf.float64))
    with tf.name_scope('train_op'):
        train_op = tf.train.AdamOptimizer(1e-3).minimize(loss)
    init = tf.global_variables_initializer()
    batch_size =100
    train_steps =10000
    with tf.Session() as sess:
        sess.run(init)




